<html>
    <head>
        <title>Fanyi</title>
        <!--disable zooming for mobile phone-->
        <meta content='width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;' name='viewport' />
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-7675942-5']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

    <link type="text/css" rel="stylesheet" href="/css/style.css" />
    </head>
<body>

    <script type="text/javascript">
        function deleteWord(key,word){
        
            xmlhttp=new XMLHttpRequest();
            xmlhttp.open("POST","delete",true);
            xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
            xmlhttp.send("key="+key);
            word.innerHTML = '<span style="color:red">Deleted</span>';
        }

        </script>

<table id="list">
    <tr>
    <td></td>
    <td class="small"><strong>Word:</strong></td>
    <td class="small"><strong>Translation:</strong></td>
    <td class="small"><strong>翻译:</strong></td>
    <td></td>
    </tr>

    {%for word in words%}
    <tr>
        <td><a href="javascript:deleteWord('{{word.key}}',{{word.word}})"><span style="color:red">X</span></a>
        </td><td><div id="{{word.word}}">{{word.word}}</div></td>
        <td>{{word.translation_en}}</td>
        <td>{{word.translation_zh}}</td>
        <td><a href="http://tyda.se/search?form=1&w={{word.word}}" target="_blank">tyda.se</a></td>
    </tr>
    {% endfor %}
</table>

<br />
{{count}}
</body>
</html>